package org.eenie.kdassistant.ui.setting;

import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;

import org.eenie.kdassistant.R;
import org.eenie.kdassistant.injector.components.AppComponent;
import org.eenie.kdassistant.ui.BaseActivity;
import org.eenie.kdassistant.ui.login.xz.XingZheLoginActivity;
import org.eenie.kdassistant.ui.login.xz.ZZTLoginWebActivity;

public class SettingActivity extends BaseActivity {

    @Override
    public int initContentView() {
        return R.layout.activity_setting;
    }

    @Override
    public void initInjector() {

    }

    @Override
    public void initUiAndListener() {

    }

    @Override
    protected boolean isApplyStatusBarTranslucency() {
        return false;
    }

    @Override
    protected boolean isApplyStatusBarColor() {
        return false;
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        menu.add("行者登录");
        menu.add("快递员登录");
        menu.add("掌中通登录");
        menu.add("韵达登录");
        return super.onCreateOptionsMenu(menu);
    }


    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        if (item.getItemId() == android.R.id.home) {
            finish();
            return true;
        }

        if (item.getTitle().equals("行者登录")) {
            startActivity(new Intent(mContext, XingZheLoginActivity.class)
                    .putExtra("src", 0));
        } else if (item.getTitle().equals("快递员登录")) {

            startActivity(new Intent(mContext, XingZheLoginActivity.class).putExtra("src", 1));
        } else if (item.getTitle().equals("韵达登录")) {

            startActivity(new Intent(mContext, XingZheLoginActivity.class).putExtra("src", 2));
        } else if (item.getTitle().equals("掌中通登录")) {

            startActivity(new Intent(mContext, ZZTLoginWebActivity.class));
        }
        return super.onOptionsItemSelected(item);
    }

    @Override
    public AppComponent getApplicationComponent() {
        return super.getApplicationComponent();
    }
}
